package com.joysuch.wwyt.api.mh.test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

public class SocketThread extends Thread {



    @Override
    public void run(){

        try {
            ServerSocket server = new ServerSocket(7777);
            Socket incoming = server.accept();
            System.out.println("...........socket init ");


            while (true){

                if(incoming.getInputStream() != null){
                    BufferedReader in = new BufferedReader(new
                            InputStreamReader(incoming.getInputStream()));
                    PrintWriter out = new PrintWriter(incoming.getOutputStream(),true);
                    out.println();
                    out.close();
                }

            }



        } catch (IOException e) {
            e.printStackTrace();
        }



    }

}
